package com.qf.fmcommodity.user.controller;

import com.qf.fmcommodity.user.entity.UserAddr;
import com.qf.fmcommodity.user.service.IUserAddrService;
import com.qf.fmcommodity.user.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 用户地址  前端控制器
 * </p>
 *
 * @author 苇名一心
 * @since 2023-02-13
 */
@RestController
@RequestMapping("/useraddr")
@CrossOrigin
public class UserAddrController {

    @Autowired
    IUserAddrService userAddrService;

    @GetMapping("/list")
    public LoginVo listaddr(Integer userId){

        List<UserAddr> data = userAddrService.listaddr(userId);

        return LoginVo.ok(data);

    }


}
